package veterinaria.servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//import veterinaria.modelo.Cita;
import veterinaria.modelo.Cita;
import veterinaria.modelo.Especie;
import veterinaria.modelo.Paciente;
//import veterinaria.negocio.GestionPaciente;
import veterinaria.negocio.GestionPaciente;
import veterinaria.negocio.GestionCita;



/**
 * Servlet implementation class CitaIngresoServlet
 */
@WebServlet("/CitaIngresoServlet")
public class CitaIngresoServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public CitaIngresoServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Integer pPac=Integer.parseInt(request.getParameter("cboPaciente"));
//		Integer pEsp=Integer.parseInt(request.getParameter("cboEspecie"));
//		Integer pRaz=Integer.parseInt(request.getParameter("cboRaza"));
//		Integer pCli=Integer.parseInt(request.getParameter("cboCliente"));
//        String pFec = request.getParameter("txtFecha");
//        String pHor = request.getParameter("txtHora");
//        Integer pEst=Integer.parseInt(request.getParameter("cboEstado"));
        
        try {
        	Paciente cPac = new Paciente();
        	cPac.setPacCodigo(pPac);
//           GestionCita negocio = new GestionCita();
//            negocio.insertar(pFec, pHor, pEst, pPac, pEsp, pRaz,pCli);
//            request.setAttribute("aPaciente", negocio.buscarPorNombre(pFec));
            RequestDispatcher rd = request.getRequestDispatcher("CitaIngreso.jsp");
            rd.forward(request, response);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }		
	}

}
